package huawei;
import java.math.BigInteger;
import java.util.Scanner;

public class Main {
 public static char[] mapping = { 'F', 'G', 'R', 'S', 'T', 'L', 'M', 'N', 'O', 'P', 'Q', 'W', 'X', 'Y', 'Z', 'U',
   'A', 'G', 'H', 'I', 'J', 'K', 'B', 'C', 'D', 'E', 'l', 'm', 'n', 'o', 'p', 'i', 'j', 'k', 'f', 'g', 'h',
   'a', 'b', 'c', 'd', 'e', 'q', 'r', 'w', 'x', 'y', 'z', 's', 't', 'u', 'v' };

 public static void main(String[] args) {

  Scanner sc = new Scanner(System.in);
  String str=sc.next().trim();
  String[] arr = str.split("#");
  int length = mapping.length;
  double index = 0;
  StringBuffer buffer = new StringBuffer();
  for (String a : arr) {
   if (a.equals("")) {
    System.out.println("");
   }
   if (!"".equals(a)) {
    StringBuffer buf = new StringBuffer();
    for (int i = 0; i < a.length(); i++) {
     switch (a.charAt(i)) {
     case '.':
      buf.append("1");
      break;
     case '-':
      buf.append("0");
      break;
     }
    }
    BigInteger big = new BigInteger(buf.toString(), 2);
    index = big.doubleValue();
    if (index < length) {
     buffer.append(mapping[(int) index]);
    } else {
     buffer = null;
     System.out.println("ERROR");
     break;
    }
   }
  }
  if (buffer != null) {
   System.out.println(buffer.toString());
  }
 }
}